﻿@using CP_SchoolForChildren_v0._1.Controllers.Support
@using CP_SchoolForChildren_v0._1.Models.DataModel
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>@ViewBag.Title</title>
        <link href="@Url.Content("~/Content/FE/style.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/Effect/EffectIndex.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/FE/style/style.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/FE/style/SchoolStyle.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/FE/style/SchoolStyle1.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/BE/jts/themes/base/jquery-ui.css")" rel="stylesheet"
              type="text/css" />
        <link href="@Url.Content("~/Content/Effect/style_common.css")" rel="stylesheet" type="text/css" />
        <script src="@Url.Content("~/Scripts/FE/jquery-1.8.2.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/FE/jquery-ui-1.9.0.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/FE/jquery.horizontalNav.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/Support/SFC_Script_01.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/Support/SFC-Search-Support.js")" type="text/javascript"></script>
    </head>
    <body>
        <!-- user bar start -->
        <div id="userbar">
            <div style="float: right; width: 50%">
                @if (!User.Identity.IsAuthenticated)
                {
                    <!-- Form đăng nhập -->

                    <form class="form-2" method="POST" action="@Url.Action("LogOn", "Account")">
                        <input type="text" name="username" placeholder="Tên đăng nhập">
                        <input type="password" name="password" placeholder="Mật khẩu"> 
                        
                        <label style="color: white; float: left; padding-top: 10px;">
                            <input type='checkbox' value="true" style="float: left" id='RememberMe' name="RememberMe">Ghi nhớ?
                        </label>
                        <input type="submit" name="submit" value="Đăng nhập">
                        <a class="regislink" href="@Url.Action("Register", "Account")" style="float: left;">Đăng ký</a>
                    </form>


                    <!-- hết form đăng nhập -->
                }
                else
                {
                    var fc = new FunctionController();
                    var userId = fc.CurrentUserID(User.Identity.Name);

                    <ol class="userlink" style="float: right;">
                        <li><span style="color: white; font-weight: bold">Xin chào, </span></li>
                        <li><a href="@Url.Action("ViewUserProfile", "User", new {id = userId})">@User.Identity.Name,</a></li>
                        @if (@User.IsInRole("Admin"))
                        {
                            <li>
                                @Html.ActionLink("Quản lý hệ thống", "Index", "SchoolManagement")
                            </li>
                            <li>
                                @Html.ActionLink("Quản lý bài viết", "ArticleManagement", "Article")
                            </li>
                        }
                        else if (@User.IsInRole("Editor"))
                        {
                            <li>
                                @Html.ActionLink("Quản lý bài viết", "ArticleManagement", "Article")
                            </li>
                        }
                        <li>@Html.ActionLink("Thoát", "LogOff", "Account")</li>
                    </ol>
                }
            </div>
           
        </div>
        <!-- user bar end -->
        <div class="allpage">
            <!--header start -->
            <div id="header">
            </div>
            <div id="topnav">
                <nav class="horizontal-nav full-width horizontalNav-notprocessed">
                    <ul style="display: table; float: none; width: 100%;">
                        <li>@Html.ActionLink("Trang chủ", "Index", "Home")</li>
                        <!--li>@Html.ActionLink("Tìm trường", "Map", "School")</li -->
                        <li>@Html.ActionLink("Hỏi đáp mỗi ngày", "Index", "QA")</li>
                        <li>@Html.ActionLink("Chăm sóc bé yêu", "Index", "Article")</li>
                        <li>@Html.ActionLink("Trợ giúp", "Help", "Home")</li>
                        <li>@Html.ActionLink("Liên hệ", "Contact", "Home")</li>
                    </ul>
                </nav>
                <script>
                    $(document).ready(function () {
                        // Call horizontalNav on the navigations wrapping element
                        $('.full-width').horizontalNav({});
                    });
                </script>
            </div>
            <!-- br class="clearfix"/ --    >
            <!--header end -->
            <!--body start -->
            <div id="body">
                @RenderSection("Result", false)
                @RenderBody()
                <br class="spacer" />
            </div>
            <!--body end -->
        </div>
        <!--footer start -->
        <!-- div style="padding-bottom: 10px;" class="bottompage"></div -->
        <div id="footer">
            <div id="footer-inner">
                
            </div>
        </div>

        <!--footer end -->
    </body>
</html>